<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles"
	prefix="tiles"%>

<rich:panel header="#{messages['rci.bulk.bank.mgmt.label']}">
	<h:panelGrid>
		<h:outputText value="#{errorBean.errorMessage}" styleClass="error"></h:outputText>
	</h:panelGrid>
	
	<h:panelGrid width="100%">
	    <h:outputText value="#{messages['rci.assignment.label']}" styleClass="sub_header" />
	</h:panelGrid>
	
	<h:panelGrid columns="4">
		<h:outputLabel for="searchBy" value="#{messages['search.by.label']}" styleClass="standardText_Label" />
		<t:selectOneMenu id="searchBy" styleClass="standardText" value="#{adminRCIBean.searchField}" required="true">
				<f:selectItems value="#{adminRCIBean.selectSearchList}"/>
		</t:selectOneMenu>
		<t:inputText size="20" maxlength="20" styleClass="standardText" value="#{adminRCIBean.searchKeyword}"></t:inputText>
		<h:commandButton value="#{messages['search']}" action="#{adminRCIBean.searchRCIAssignmentAction}" 
					actionListener="#{adminRCIBean.searchRCIAssignmentActionEvent}" styleClass="button">
		</h:commandButton>
	</h:panelGrid>
	
	<h:panelGrid width="100%" columns="1">
	    <h:panelGroup>
			<rich:dataTable id="data" var="rciAssignment" value="#{adminRCIBean.rciAssignmentList}" rows="20" width="99%">
				<rich:column style="text-align:center;width:5%;" >
					<f:facet name="header">
						<h:selectBooleanCheckbox id="chkAll" onclick="checkAll(this.form,this)" ></h:selectBooleanCheckbox>
					</f:facet>
					<h:selectBooleanCheckbox id="chk" value="#{rciAssignment.markAsSelect}"></h:selectBooleanCheckbox>
				</rich:column>
				
				<rich:column style="text-align:center;width:30%;">
					<f:facet name="header">
						<h:outputText value="#{messages['rci.assignment.no.column']}"></h:outputText>
					</f:facet>
				
					<h:commandLink action="#{adminRCIBean.navUpdateRCIAssignmentAction}" actionListener="#{adminRCIBean.navUpdateRCIAssignmentActionEvent}">
						<h:outputText value="#{rciAssignment.rciAssignmentNo}"></h:outputText>
					</h:commandLink>
					<f:param id="rciAssignmentId" value="#{rciAssignment.rciAssignmentId}" />
				</rich:column>
				
				<rich:column style="text-align:center;width:30%;">
					<f:facet name="header">
						<h:outputText value="#{messages['rci.assignment.date.column']}"></h:outputText>
					</f:facet>
					<h:outputText value="#{rciAssignment.rciAssignmentDate}">
						<f:convertDateTime pattern="dd/MM/yyyy" timeZone="Asia/Kuala_Lumpur"/>
					</h:outputText>
				</rich:column>
				
				<rich:column style="text-align:center;width:30%;">
					<f:facet name="header">
						<h:outputText value="#{messages['rci.member.rci.no.column']}"></h:outputText>
					</f:facet>
				    <h:outputText value="#{rciAssignment.rciMember.rciNo}"></h:outputText>
				</rich:column>	
				
				
			</rich:dataTable>
		</h:panelGroup>
		
		<rich:datascroller align="left"  for="data" maxPages="20" />
		
		<t:panelGrid columns="2" columnClasses="standardTable_ColumnLeft_20,standardTable_ColumnLeft_80" width="100%">
			<h:outputText></h:outputText>
			<h:panelGrid columns="2">
				<h:commandButton value="#{messages['add.rci.assignment.button']}" action="#{adminRCIBean.navAddRCIAssignmentAction}" 
					actionListener="#{adminRCIBean.navAddRCIAssignmentActionEvent}" styleClass="button">
				</h:commandButton>
				
				<h:commandButton value="#{messages['remove.rci.assignment.button']}" action="#{adminRCIBean.deleteRCIAssignmentAction}" 
					actionListener="#{adminRCIBean.deleteRCIAssignmentActionEvent}" onclick="#{messages['delete.msg.alert']}" styleClass="button">
				</h:commandButton>
			</h:panelGrid>
		</t:panelGrid>
	</h:panelGrid>
	
</rich:panel>	